Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-export jsonrpsee from subxt::ext #1843

Merged
merged 1 commit into from
Oct 26, 2024
Merged

Re-export jsonrpsee from subxt::ext #1843

merged 1 commit into from
Oct 26, 2024

Conversation

pgherveou
Copy link
Contributor

Re-export so that downstream code can downcast RpcError to ErrorObject

@pgherveou pgherveou requested a review from a team as a code owner October 25, 2024 13:35
subxt/src/error/mod.rs Outdated Show resolved Hide resolved
@jsdw
Copy link
Collaborator

jsdw commented Oct 25, 2024

I think you're referring to downcasting the RpcError::Client into the jsonrpsee error, which is jsonrpsee_core::client::Error by the looks of it.

I'm not against exposing that here as something like JsonrpseeClientError, but it would also need to be behind the "jsonrpsee" feature flag :)

@pgherveou
Copy link
Contributor Author

I think you're referring to downcasting the RpcError::Client into the jsonrpsee error, which is jsonrpsee_core::client::Error by the looks of it.

I'm not against exposing that here as something like JsonrpseeClientError, but it would also need to be behind the "jsonrpsee" feature flag :)

I am trying to get this to work so I can unwrap the nested error message

https://github.com/paritytech/polkadot-sdk/blob/79294d4d2ffa4c4b9102836d1170f03b71bc1c24/substrate/frame/revive/rpc/src/client.rs?plain=1#L112-L119

subxt/src/error/mod.rs Outdated Show resolved Hide resolved
subxt/src/error/mod.rs Outdated Show resolved Hide resolved
@niklasad1
Copy link
Member

@pgherveou

Can you move the jsonrpsee re-export to here instead? Then all good

subxt/src/error/mod.rs Outdated Show resolved Hide resolved
@niklasad1 niklasad1 changed the title Re-export ErrorObject Re-export jsonrpsee from subxt::ext Oct 25, 2024
@pgherveou pgherveou merged commit 251a925 into master Oct 26, 2024
13 checks passed
@pgherveou pgherveou deleted the pg/reexport-err branch October 26, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants